<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	BillMoneyInputPageData obj = (BillMoneyInputPageData)context.getValue("BillMoneyInputPageData");
    String billType = (String)context.getSessionValue("BillType");
%>

<!--********************* Part3:JavaScript Code ***************-->
<script language="javascript">

var g_check_items = new Array();
var g_i = 0 ;

g_check_items[g_i++] = new CheckItem("仓库编码","WarehouseCode",true,true,20,false,0);

g_check_items[g_i++] = new CheckItem("产品名称","ProductName",true,true,50,false,0);

g_check_items[g_i++] = new CheckItem("规格","Spec",false,true,200,false,0);

g_check_items[g_i++] = new CheckItem("型号","Model",false,true,200,false,0);

g_check_items[g_i++] = new CheckItem("计量单位","Unit",true,true,20,false,0);

g_check_items[g_i++] = new CheckItem("数量","Count",true,false,0,true,CHECK_ITEM_TYPE_DOUBLE);

g_check_items[g_i++] = new CheckItem("单价","Price",true,false,0,true,CHECK_ITEM_TYPE_DOUBLE);

g_check_items[g_i++] = new CheckItem("总价","Money",true,false,0,true,CHECK_ITEM_TYPE_DOUBLE);

g_check_items[g_i++] = new CheckItem("供应商名称","ProviderName",false,true,50,false,0);

g_check_items[g_i++] = new CheckItem("费用日期","BillDate",true,true,20,false,0);

function doSaveAndNew()
{
	if(!CheckInput(g_check_items)) return false;
	SetAction("saveAndNewBillMoneyInput");
	frm.submit();
}
function doSave()
{
	if(!CheckInput(g_check_items)) return false;
	SetAction("saveBillMoneyInput");
	frm.submit();
}
function doCancel()
{
	SetAction("backListBillMoneyInput");
	frm.submit();
}

//6 数量计算
function onInputQtyAndTotal()
{
    var qty = GetValue("Count");
    var price = GetValue("Price");
    
    //数量为空
    if (qty==null || ""==qty)
    {
        SetValue("Count","");
        qty=0;
    }else{
        qty=parseFloat(qty);
    }

    //价格为空
    if (price==null || ""==price)
    {
        SetValue("Price","");
        price=0;
    }else{
        price=parseFloat(price);
    }   
    var money=qty*price;
    SetValue("Money", FormatNumber(money,2));
}

key_InitDefault();
key_RegSubmitHandler(doSaveAndNew);
</script>

<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->

<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code">

<input type=hidden name="Id" value="<%=obj.getId()%>">
<input type=hidden name="type" value="<%= billType %>">


<br>


<%=UIManager.addEditHeadTitle("总成件外修维护")%>


<!--********************* Part5:Edit Area  ***************-->
<%=uiEditStart%>>
<%
	int key_tab = 1 ;
%>

    <%=uiEditTR%>>
        <%=uiEditHeadTD%> width=250>总成件外修类型：</td>
        <%=uiEditTD%>><!--loginInfo.getLogin-->
            <%=SelectManager.viewInputMoneyType("BillType",obj.viewBillType(con),false,"","","","key_tab="+(key_tab++))%><font color=red>*</font>
        </td>
    </tr>

	<%=uiEditTR%>>
        <%=uiEditHeadTD%> width=250>所属仓库：</td>
        <%=uiEditTD%>><!--loginInfo.getLogin-->
            <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"WarehouseCode",obj.viewWarehouseCode(con),false,"","","","key_tab="+(key_tab++))%><font color=red>*</font>
        </td>
    </tr>
	
	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>产品名称：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="ProductName" size=20  value="<%=obj.viewProductName(con)%>" key_tab="<%=key_tab++%>"><font color=red>*</font>
		</td>
	</tr>
	
	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>规格：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Spec" size=20  value="<%=obj.viewSpec(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>型号：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Model" size=20  value="<%=obj.viewModel(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>计量单位：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Unit" size=20  value="<%=obj.viewUnit(con)%>" key_tab="<%=key_tab++%>"><font color=red>*</font>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>数量：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Count" size=20  value="<%=obj.viewCount(con)%>" onBlur="onInputQtyAndTotal()" key_tab="<%=key_tab++%>"><font color=red>*</font>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>单价：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Price" size=20  value="<%=obj.viewPrice(con)%>" onkeyup="onInputQtyAndTotal()" onBlur="onInputQtyAndTotal()" key_tab="<%=key_tab++%>"><font color=red>*</font>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>总价：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Money" size=20  value="<%=obj.viewMoney(con)%>" readonly="true"><font color=red>*</font>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>供应商名称：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="ProviderName" size=20  value="<%=obj.viewProviderName(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	

	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>费用日期：</td>
		<%=uiEditTD%>>
            <%=framework.custom.UIManager.generateDateInput(true, "BillDate", obj.viewBillDate(con))%><font color=red>*</font>
		</td>
	</tr>
	
<%=uiEditEnd%>

<!--********************* Part6:Action Area  ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
   		<%=uiCommandTD%>>                     
			<input type=button class="buttons" value=" 保存&添加 " onclick="doSaveAndNew();return false;">
			<input type=button class="buttons" value="    保存   " onclick="doSave();return false;">
			<input type=button class="buttons" value="    返回   " onclick="doCancel();return false;">
		</td>
	</tr>
<%=uiCommandEnd%>
</form>

<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :Arrow
	FileName  :/system/base/BillMoneyInputEdit.jsp
-->
